/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javalens.rwrapper;

import javalens.astronomy.LightCurve;
import javalens.*;

/**
 *
 * @author Pierre
 */
public class PlotLib {

    public static void pausedPlot(double[] x, double[] y) {
        REngineWrapper w = REngineWrapper.getREngineWrapper();
        w.eval("windows()");
        w.eval("myx<-" + w.arrayToRString(x));
        w.eval("myy<-" + w.arrayToRString(y));
        w.eval("plot(myx,myy, pch=\".\")");
        w.eval("locator()");
        w.eval("dev.off()");
    }
    
    public static void pausedPlot(LightCurve curve) {
        REngineWrapper w = REngineWrapper.getREngineWrapper();
        w.eval("windows()");
        w.eval("myx<-" + w.arrayToRString(curve.getDays()));
        w.eval("myy<-" + w.arrayToRString(curve.getMags()));
        w.eval("plot(myx,-myy, pch=\".\")");
        w.eval("locator()");
        w.eval("dev.off()");
    }
    
}
